<div id="content">
	<div id="left">
		<?php
		$this->widget ( 'application.modules.manage.widgets.ViewWidgets', array (
				'view' => 'nav_contentmore' 
		) );
		?>
	</div>
	<div id="right">
		<div class="box">
			<div class="title">
				<h5>内容管理>查看留言</h5>
			</div>
			<form action="index" name="form_view">
				 <input type="hidden" name="current"/>
				<div class="table">
					<table>
						<thead>
							<tr>
                                <th class="tal">作者</th>
                                <th>已读</th>
								<th>是否审核</th>
                                <th>模块</th>
								<th>提交时间</th>
								<th class="last" style="width: 150px;">工具</th>
							</tr>
						</thead>
						<tbody>
						<?php
						if(sizeof($messages)>0){
foreach ( $messages as $m ) {
	?>
<tr>
                                <td class="tac"><?php echo $m['user'];?></td>
                                <td class="tac"><?php
                                    if($m['haveread']==0){
                                        echo "<span class='red'>否</span>";
                                    }else{
                                        echo "是";
                                    }
                                ?></td>
								<td class="tac"><?php
                                    if($m['isAuth']==0){
                                        echo "<span class='red'>否</span>";
                                    }else{
                                        echo "是";
                                    }
                                ?></td>
                                <td class="tac"><?php echo $m['category']; ?></td>
								<td class="tac"><?php echo $m['createtime'];?></td>
								<td class="tac"><button class="btn" onclick="showedit(<?php echo $m['message_id']; ?>)">编辑</button>&nbsp;&nbsp;<button class="btn" onclick="del(<?php echo $m['message_id']; ?>)" >删除</button></td>
							</tr>
<?php
						}
}
						
						?>
					</tbody>
					</table>
				<?php echo $pagebar->buildBar();?>
			</div>
			</form>
		</div>
	</div>
</div>
<script>
    var current = <?php echo $pagebar->current;?>;
    function showedit(id){
        window.location.href="showedit?id="+id+"&current="+current;
    }
    function del(id){
        confirm(function(){
            window.location.href="del?id="+id+"&current="+current;
        },'是否删除消息？')
    }
</script>